Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 3 - Geometric Styles / Geometric Styles Reference
Functions / Getting and Setting Caps


GXGetStyleCap

You can use the GXGetStyleCap function to retrieve the cap information from a style object.

gxCapRecord *GXGetStyleCap(gxStyle source, gxCapRecord *cap);
source
The style object whose cap information you want to retrieve.
cap
A pointer to a gxCapRecord structure. On return, this structure contains the cap information for the source style object.
function result
A copy of the gxCapRecord associated with the source style.
DESCRIPTION
The GXGetStyleCap function returns as its function result, and in the cap parameter, a gxCapRecord structure containing the cap information for the style object specified by the source parameter.

This function creates new shapes to encapsulate the start cap and end cap geometries, and places references to these shapes in the startCap and endCap fields of the returned gxCapRecord structure. You should dispose of these shapes when you no longer need them.

Since this function copies the cap information from the source style object, you may make changes to the gxCapRecord structure returned by this function without affecting the source style's cap information. If you want to change the cap information in the source style, you must use the GXSetStyleCap function.

SPECIAL CONSIDERATIONS
If no error results, the GXGetStyleCap function creates shapes; you are responsible for disposing of these shapes when you no longer need them. See Inside Macintosh: QuickDraw GX Objects for information about disposing QuickDraw GX objects.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
style_is_nil 
parameter_is_nil(debugging version)
SEE ALSO
For a discussion of start and end caps, see "Caps" on page 3-23.

For examples of adding caps to a shape, see "Adding Caps to a Shape" on page 3-57 and "Adding Standard Caps to a Shape" on page 3-59.

For a discussion of the gxCapRecord structure and a description of what types of shapes you can use as cap shapes, see "The Cap Structure" on page 3-99.

To specify cap information for a style object, use the GXSetStyleCap function, which is described in the next section.

To retrieve cap information from a style object associated with a particular shape, use the GXGetShapeCap function, which is described on page 3-126. To specify cap information for a style object associated with a particular shape, use the GXSetShapeCap function, which is described on page 3-128.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help